home *** CD-ROM | disk | FTP | other *** search
- ##########################################################
- # GDIdB demo script (c) 1997 Global Data Industries
- # Datasource=foodstore.xls (Excel spreadsheet)
- #
- # In this basic example, the contents of the spreadsheet
- # is merged with the site html using html table tags, producing
- # a table similar to the spreadsheet itself.
- ##########################################################
-
-
-
-
-
- ##########################################################
- # declare variables used by script
- &defvar(?name?,?test?)
-
-
-
-
-
- ##########################################################
- # Print the information screen
-
- &cls
- &print("Foodstore Demo Script")
- &print("---------------------------------")
-
-
-
-
-
- ##########################################################
- # get the name of the person running the script
-
- &input(?name?,"Please enter your name")
-
-
-
-
-
- ##########################################################
- # Declare the ODBC datasource
-
- &datasource("Driver={Microsoft Excel Driver (*.xls)};DBQ=foodstore.xls")
-
-
-
-
-
- ##########################################################
- # generate html
-
- &print("Generating HTML...")
- &html("index.html")
- {
- <HTML>
- <HEAD>
- <TITLE>The Essential Programmer's Online Foodstore</TITLE>
- </HEAD>
- <BODY BACKGROUND="burger.gif">
- <IMG SRC="fries.gif" ALIGN=LEFT>
- <IMG SRC="fries.gif" ALIGN=RIGHT>
- <CENTER>
- <BR><BR>
- <FONT COLOR="\#B48424">
- <H1>The Essential Programmer's<BR>
- Online Foodstore</H1>
- </FONT>
- <BR CLEAR=LEFT>
- <TABLE BORDER=0 WIDTH=80%>
- <TR><TD><FONT FACE="Arial,Helvetica">
- <P>Here at <B>The Essential Programmer's Online Foodstore,</B>
- we <I>know</I> a serious coding session requires <I>full and professional</I>
- support. That's why we've given you that support. Where you want it. Online.
- When you want it. 24 Hours a day. Every day. (Unless we're at the beach)
- <P>The Essential Programmer's Online Foodstore. More than just a luxury, we
- <I>DARE</I> you to try programming without our URL in your bookmarks!
- <BR><BR><BR>
- <FONT COLOR=RED SIZE=+1>Site updated
-
- # only include user's name if they actually bothered to enter it!
- &strcmp(?test?,"",ne,"?name?")
- &if(?test?)
- {
- by ?name?
- }
-
- at ?gdidbtime? on ?gdidbdate.dn? ?gdidbdate?.</FONT>
-
- </FONT>
- </TD></TR>
- </TABLE>
- </CENTER>
- <BR><BR><BR>
- <CENTER>
- <IMG SRC="donut.gif"><IMG SRC="donut.gif"><IMG SRC="donut.gif"><IMG SRC="donut.gif"><IMG SRC="donut.gif"><IMG SRC="donut.gif"><IMG SRC="donut.gif">
- </CENTER>
- <FONT SIZE=+3>Price list:</FONT><BR>
- <TABLE WIDTH="100%">
- <TR>
- <TD><FONT SIZE=+2>Item</FONT></TD>
- <TD><FONT SIZE=+2>Stock</FONT></TD>
- <TD><FONT SIZE=+2>Cost</FONT></TD>
- <TD><FONT SIZE=+2>Per</FONT></TD>
- <TD><FONT SIZE=+2>VAT</FONT></TD>
- <TD><FONT SIZE=+2>Delivery</FONT></TD>
- <TD><FONT SIZE=+2>Total</FONT></TD>
- </TR>
-
- # loop through each row of the dataset, turning the spreadsheet
- # table into a HTML table
-
- &getdata("SELECT * FROM sheet")
- {
- <TR>
- <TD>?Item?</TD>
- <TD>?Stock?</TD>
- <TD>ú?Cost?</TD>
- <TD>?Per?</TD>
- <TD>ú?VAT?</TD>
- <TD>ú?Delivery?</TD>
- <TD>ú?Total?</TD>
- </TR>
- }
- </TABLE>
- <CENTER>
- <IMG SRC="donut.gif"><IMG SRC="donut.gif"><IMG SRC="donut.gif"><IMG SRC="donut.gif"><IMG SRC="donut.gif"><IMG SRC="donut.gif"><IMG SRC="donut.gif">
- </CENTER>
- </BODY>
- </HTML>
- }
-
-
-
-
-
- ##########################################################
- # print closing information
-
- &cls
- &print("Demo web site HTML generation complete! Click the HTML button to see the results.")
- &print
- &print
-
- # END OF SCRIPT
-